<?php
class authorization extends Controller{
	function index(){
		if(!$this->user->isLogged()){
			$this->response->redirect(MAIN_PAGE);
		}
		$this->load->model("dept");
		$this->data["department"]=$this->model_dept->loaddepartment()->rows;
		$this->data["user_list"]=$this->user->loaduser()->rows;
		$this->document->setTitle("Document Management Solutions");
		$this->document->setSelectedMenu("menu_setting");
		$this->children=array("header","footer");
		$this->template="authorization.html";
		$this->response->setOutput($this->render(TRUE),0);
	}


	function authorizationpost(){
		$jsonarr=array();
		if($this->request->is_ajax_request() && $this->user->isLogged()){
	         $this->user->updatepriviledge();
	         $jsonarr["status"]=true;
	         $jsonarr["msg"]="Updated Sucessfully";
		}else{
			$jsonarr["status"]=false;
			$jsonarr["redirect"]=true;
		}
		echo json_encode($jsonarr);
	}

}